package com.wzj.imperial.court.dao.impl;


import com.wzj.imperial.court.dao.BaseDAO;
import com.wzj.imperial.court.dao.api.EmpDao;
import com.wzj.imperial.court.entity.Emp;

/**
 * @Description:
 * @className com.wzj.imperial.dao.impl.EmpDaoImpl
 * @Author: wzj
 * @CreateTime: 2022-11-08  18:00
 */
public class EmpDaoImpl extends BaseDAO<Emp> implements EmpDao {

    @Override
    public Emp selectEmpByLoginAccount(String loginAccount, String encodedLoginPassword) {
        // 1、编写 SQL 语句
        String sql = "select emp_id empId," +
                "emp_name empName," +
                "emp_position empPosition," +
                "login_account loginAccount," +
                "login_password loginPassword " +
                "from t_emp where login_account=? and login_password=?";

        // 2、调用父类方法查询单个对象
        return super.getSingleBean(sql, Emp.class, loginAccount, encodedLoginPassword);
    }
}
